//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    motto: 'Hello World',
    userInfo: {},
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    imgUrl: '/images/1.jpg',
    imgArr: ['/images/1.jpg', '/images/2.jpg', '/images/3.jpg', '/images/4.jpg', '/images/1.jpg'],
    desc: '美女哟',
    descStrs: ["这是我媳妇儿", "好漂亮啊", "我媳妇就是好看", "可爱&萌萌哒",  "美女哦"],
    cls: ['btn1', 'btn2', 'btn3', 'btn4', 'btn5'],
    btncls:'btn1'
  },
  onLoad: function () {
  },
  bindViewTap: function () {
    //获取数组索引
    var r = Math.random().toExponential();
    var n = parseInt(r);
    while (n > 4) {
      r = Math.random().toExponential();
      n = parseInt(r);
    }
    this.setData({
      imgUrl: this.data.imgArr[n],
      desc: this.data.descStrs[n],
      btncls:this.data.cls[n]
    });
  }
})


